package com.primeton.eos.oss.model.dao;

import org.springframework.stereotype.Repository;
import com.eos.spring.dao.AbstractDatabaseDao;
import com.eos.spring.dao.CriteriaBuilder;
import com.eos.system.utility.PageResultList;
import com.primeton.eos.oss.model.newdataset.CrecAccount;

@Repository
public class CrecAccountDao extends AbstractDatabaseDao {

	public PageResultList<CrecAccount> queryCrecAccountsWithPage(String username, int pageSize, int pageIndex) {
		CriteriaBuilder cb = new CriteriaBuilder(CrecAccount.QNAME);

		if (null != username && !"".equals(username)) {
			cb.and("username", username);
		}
		return queryEntitiesByCriteriaWithPage(cb.build(), pageIndex, pageSize);
	}

	public CrecAccountDao() {
		super.setDataSourceName("mdmpub");
	}
}
